<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>

<script type="text/javascript">
$(document).ready(function(){
  /* --- Alignment and width --- */
  
  var wWidth = $(window).width();
  var wHeight = $(document).height();

  var headerHeight = parseInt($("#header").css("height"));
  
  var cPanelWidth = parseInt($("div#cPanel").css('width')) | 0;
  var containerWidth = wWidth - cPanelWidth - 60;
  
  $("div#container").css("padding", "0px 20px");
  $("div#container").css("width", (containerWidth) + "px");
  
  $("div.half_container").css('width', (containerWidth/2 - 20) + "px");
  $("div.one_third_container").css('width',containerWidth/4 - 24 + "px");
  
  var contHeight = parseInt($("div#container").css("height")); 
  $("div#cPanel").css("height",  wHeight   +"px");
  
  /* -- cPanel animation -- */
  $("div#cPanel div.menu div.menu_header span.cPanel_toggler").each(function(){
    var header = $(this).parent("div.menu_header");
    var body = $($(header).parent("div.menu")).children("div.menu_body");
    //$(body).css('background', '#F90');
    $(this).click(function(){
      $(body).slideToggle('fast');
    });
  });
  /* -- Page Help Navigation -- */
  $("span#help-button").click(function(){
    var pgNav = $(this).parent("div.page-help-navigator");
    var pgHeader = $(pgNav).parent("div#page-header");
    var pgNavSec = $(pgHeader).children("div.page-help-section");
    //alert(pgNavSec.html());
    $(pgNavSec).slideToggle("fast");
  })
  
  /* -- jQuery UI Calendar -- */
  $( "input.datetype" ).datepicker({ altFormat: 'yy-mm-dd' });
 
});
</script>
